home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / samba.idb / usr / samba / src / source / proto.h.z / proto.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  70.2 KB  |  1,568 lines

  1. /* This file is automatically generated with "make proto". DO NOT EDIT */
  2.  
  3.  
  4. /*The following definitions come from  access.c  */
  5.  
  6. BOOL check_access(int snum);
  7. BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr);
  8.  
  9. /*The following definitions come from  asyncdns.c  */
  10.  
  11. int asyncdns_fd(void);
  12. void kill_async_dns_child(void);
  13. void start_async_dns(void);
  14. void run_dns_queue(void);
  15. BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
  16.              struct name_record **n);
  17. BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question,
  18.              struct name_record **n);
  19. void kill_async_dns_child(void);
  20.  
  21. /*The following definitions come from  cgi.c  */
  22.  
  23. void cgi_load_variables(FILE *f1);
  24. char *cgi_variable(char *name);
  25. char *cgi_vnum(int i, char **name);
  26. int cgi_boolean(char *name, int def);
  27. char *quotedup(char *s);
  28. char *urlquote(char *s);
  29. char *quotequotes(char *s);
  30. void quote_spaces(char *buf);
  31. void cgi_setup(char *rootdir);
  32.  
  33. /*The following definitions come from  charcnv.c  */
  34.  
  35. char *unix2dos_format(char *str,BOOL overwrite);
  36. char *dos2unix_format(char *str, BOOL overwrite);
  37. void interpret_character_set(char *str);
  38.  
  39. /*The following definitions come from  charset.c  */
  40.  
  41. void charset_initialise(void);
  42. void codepage_initialise(int client_codepage);
  43. void add_char_string(char *s);
  44.  
  45. /*The following definitions come from  chgpasswd.c  */
  46.  
  47. BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root);
  48. BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root);
  49. BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root);
  50. BOOL check_lanman_password(char *user, unsigned char *pass1, 
  51.                            unsigned char *pass2, struct smb_passwd **psmbpw);
  52. BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2);
  53. BOOL check_oem_password(char *user, unsigned char *data,
  54.                         struct smb_passwd **psmbpw, char *new_passwd,
  55.                         int new_passwd_size);
  56. BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override);
  57.  
  58. /*The following definitions come from  client.c  */
  59.  
  60. void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num);
  61. void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo);
  62. void cmd_help(char *dum_in, char *dum_out);
  63.  
  64. /*The following definitions come from  clientgen.c  */
  65.  
  66. BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation);
  67. BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
  68.                void (*fn)(char *, uint32, char *));
  69. BOOL cli_session_setup(struct cli_state *cli, 
  70.                char *user, 
  71.                char *pass, int passlen,
  72.                char *ntpass, int ntpasslen,
  73.                char *workgroup);
  74. BOOL cli_ulogoff(struct cli_state *cli);
  75. BOOL cli_send_tconX(struct cli_state *cli, 
  76.             char *share, char *dev, char *pass, int passlen);
  77. BOOL cli_tdis(struct cli_state *cli);
  78. BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst);
  79. BOOL cli_unlink(struct cli_state *cli, char *fname);
  80. BOOL cli_mkdir(struct cli_state *cli, char *dname);
  81. BOOL cli_rmdir(struct cli_state *cli, char *dname);
  82. int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode);
  83. BOOL cli_close(struct cli_state *cli, int fnum);
  84. BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
  85. BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout);
  86. int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size);
  87. int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size);
  88. BOOL cli_getatr(struct cli_state *cli, char *fname, 
  89.         int *attr, uint32 *size, time_t *t);
  90. BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t);
  91. BOOL cli_qpathinfo(struct cli_state *cli, char *fname, 
  92.            time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size);
  93. BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, 
  94.             time_t *c_time, time_t *a_time, time_t *m_time, 
  95.             time_t *w_time, uint32 *size);
  96. BOOL cli_qfileinfo(struct cli_state *cli, int fnum, 
  97.            time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size);
  98. BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password,
  99.                              char *old_password);
  100. BOOL cli_negprot(struct cli_state *cli);
  101. BOOL cli_session_request(struct cli_state *cli, char *host, int name_type,
  102.              char *myname);
  103. BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip);
  104. BOOL cli_initialise(struct cli_state *cli);
  105. void cli_shutdown(struct cli_state *cli);
  106. char *cli_errstr(struct cli_state *cli);
  107. void cli_error(struct cli_state *cli, int *eclass, int *num);
  108. void cli_sockopt(struct cli_state *cli, char *options);
  109. int cli_setpid(struct cli_state *cli, int pid);
  110.  
  111. /*The following definitions come from  clientutil.c  */
  112.  
  113. void cli_setup_pkt(char *outbuf);
  114. BOOL cli_call_api(char *pipe_name, int pipe_name_len,
  115.             int prcnt,int drcnt, int srcnt,
  116.              int mprcnt,int mdrcnt,
  117.              int *rprcnt,int *rdrcnt,
  118.              char *param,char *data, uint16 *setup,
  119.              char **rparam,char **rdata);
  120. BOOL cli_receive_trans_response(char *inbuf,int trans,
  121.                                    int *data_len,int *param_len,
  122.                    char **data,char **param);
  123. BOOL cli_send_trans_request(char *outbuf,int trans,
  124.                    char *name,int namelen, int fid,int flags,
  125.                    char *data,char *param,uint16 *setup,
  126.                    int ldata,int lparam,int lsetup,
  127.                    int mdata,int mparam,int msetup);
  128. BOOL cli_send_session_request(char *inbuf,char *outbuf);
  129. BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, struct connection_options *options);
  130. void cli_send_logout(char *dum_in, char *dum_out);
  131. BOOL cli_open_sockets(int port );
  132. BOOL cli_reopen_connection(char *inbuf,char *outbuf);
  133.  
  134. /*The following definitions come from  clitar.c  */
  135.  
  136. int padit(char *buf, int bufsize, int padsize);
  137. void cmd_block(char *dum_in, char *dum_out);
  138. void cmd_tarmode(char *dum_in, char *dum_out);
  139. void cmd_setmode(char *dum_in, char *dum_out);
  140. void cmd_tar(char *inbuf, char *outbuf);
  141. int process_tar(char *inbuf, char *outbuf);
  142. int clipfind(char **aret, int ret, char *tok);
  143. int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind);
  144.  
  145. /*The following definitions come from  credentials.c  */
  146.  
  147. char *credstr(uchar *cred);
  148. void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, 
  149.               uchar session_key[8]);
  150. void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, 
  151.          DOM_CHAL *cred);
  152. int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred,
  153.         UTIME timestamp);
  154. BOOL clnt_deal_with_creds(uchar sess_key[8],
  155.               DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred);
  156. BOOL deal_with_creds(uchar sess_key[8],
  157.              DOM_CRED *sto_clnt_cred, 
  158.              DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred);
  159.  
  160. /*The following definitions come from  dir.c  */
  161.  
  162. void init_dptrs(void);
  163. char *dptr_path(int key);
  164. char *dptr_wcard(int key);
  165. BOOL dptr_set_wcard(int key, char *wcard);
  166. BOOL dptr_set_attr(int key, uint16 attr);
  167. uint16 dptr_attr(int key);
  168. void dptr_close(int key);
  169. void dptr_closecnum(int cnum);
  170. void dptr_idlecnum(int cnum);
  171. void dptr_closepath(char *path,int pid);
  172. int dptr_create(int cnum,char *path, BOOL expect_close,int pid);
  173. BOOL dptr_fill(char *buf1,unsigned int key);
  174. BOOL dptr_zero(char *buf);
  175. void *dptr_fetch(char *buf,int *num);
  176. void *dptr_fetch_lanman2(int dptr_num);
  177. BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype);
  178. BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
  179. void *OpenDir(int cnum, char *name, BOOL use_veto);
  180. void CloseDir(void *p);
  181. char *ReadDirName(void *p);
  182. BOOL SeekDir(void *p,int pos);
  183. int TellDir(void *p);
  184. void DirCacheAdd( char *path, char *name, char *dname, int snum );
  185. char *DirCacheCheck( char *path, char *name, int snum );
  186. void DirCacheFlush( int snum );
  187.  
  188. /*The following definitions come from  fault.c  */
  189.  
  190. void fault_setup(void (*fn)(void *));
  191.  
  192. /*The following definitions come from  getsmbpass.c  */
  193.  
  194. char *getsmbpass(char *prompt)    ;
  195.  
  196. /*The following definitions come from  interface.c  */
  197.  
  198. void load_interfaces(void);
  199. void iface_set_default(char *ip,char *bcast,char *nmask);
  200. BOOL ismyip(struct in_addr ip);
  201. BOOL ismybcast(struct in_addr bcast);
  202. BOOL is_local_net(struct in_addr from);
  203. int iface_count(void);
  204. BOOL we_are_multihomed(void);
  205. struct interface *get_interface(int n);
  206. struct in_addr *iface_n_ip(int n);
  207. struct in_addr *iface_bcast(struct in_addr ip);
  208. struct in_addr *iface_nmask(struct in_addr ip);
  209. struct in_addr *iface_ip(struct in_addr ip);
  210.  
  211. /*The following definitions come from  ipc.c  */
  212.  
  213. int get_printerdrivernumber(int snum);
  214. int reply_trans(char *inbuf,char *outbuf, int size, int bufsize);
  215.  
  216. /*The following definitions come from  kanji.c  */
  217.  
  218. void interpret_coding_system(char *str);
  219. void initialize_multibyte_vectors( int client_codepage);
  220.  
  221. /*The following definitions come from  loadparm.c  */
  222.  
  223. char *lp_string(char *s);
  224. char *lp_logfile(void);
  225. char *lp_smbrun(void);
  226. char *lp_configfile(void);
  227. char *lp_smb_passwd_file(void);
  228. char *lp_serverstring(void);
  229. char *lp_printcapname(void);
  230. char *lp_lockdir(void);
  231. char *lp_rootdir(void);
  232. char *lp_defaultservice(void);
  233. char *lp_msg_command(void);
  234. char *lp_dfree_command(void);
  235. char *lp_hosts_equiv(void);
  236. char *lp_auto_services(void);
  237. char *lp_passwd_program(void);
  238. char *lp_passwd_chat(void);
  239. char *lp_passwordserver(void);
  240. char *lp_name_resolve_order(void);
  241. char *lp_workgroup(void);
  242. char *lp_username_map(void);
  243. char *lp_character_set(void);
  244. char *lp_logon_script(void);
  245. char *lp_logon_path(void);
  246. char *lp_logon_drive(void);
  247. char *lp_logon_home(void);
  248. char *lp_remote_announce(void);
  249. char *lp_remote_browse_sync(void);
  250. char *lp_wins_server(void);
  251. char *lp_interfaces(void);
  252. char *lp_socket_address(void);
  253. char *lp_nis_home_map_name(void);
  254. char *lp_announce_version(void);
  255. char *lp_netbios_aliases(void);
  256. char *lp_driverfile(void);
  257. char *lp_domain_sid(void);
  258. char *lp_domain_other_sids(void);
  259. char *lp_domain_groups(void);
  260. char *lp_domain_admin_users(void);
  261. char *lp_domain_guest_users(void);
  262. char *lp_domain_hostsallow(void);
  263. char *lp_domain_hostsdeny(void);
  264. BOOL lp_dns_proxy(void);
  265. BOOL lp_wins_support(void);
  266. BOOL lp_we_are_a_wins_server(void);
  267. BOOL lp_wins_proxy(void);
  268. BOOL lp_local_master(void);
  269. BOOL lp_domain_controller(void);
  270. BOOL lp_domain_master(void);
  271. BOOL lp_domain_logons(void);
  272. BOOL lp_preferred_master(void);
  273. BOOL lp_load_printers(void);
  274. BOOL lp_use_rhosts(void);
  275. BOOL lp_getwdcache(void);
  276. BOOL lp_readprediction(void);
  277. BOOL lp_readbmpx(void);
  278. BOOL lp_readraw(void);
  279. BOOL lp_writeraw(void);
  280. BOOL lp_null_passwords(void);
  281. BOOL lp_strip_dot(void);
  282. BOOL lp_encrypted_passwords(void);
  283. BOOL lp_update_encrypted(void);
  284. BOOL lp_syslog_only(void);
  285. BOOL lp_browse_list(void);
  286. BOOL lp_unix_realname(void);
  287. BOOL lp_nis_home_map(void);
  288. BOOL lp_time_server(void);
  289. BOOL lp_bind_interfaces_only(void);
  290. BOOL lp_net_wksta_user_logon(void);
  291. BOOL lp_unix_password_sync(void);
  292. BOOL lp_passwd_chat_debug(void);
  293. BOOL lp_ole_locking_compat(void);
  294. int lp_os_level(void);
  295. int lp_max_ttl(void);
  296. int lp_max_wins_ttl(void);
  297. int lp_min_wins_ttl(void);
  298. int lp_max_log_size(void);
  299. int lp_mangledstack(void);
  300. int lp_maxxmit(void);
  301. int lp_maxmux(void);
  302. int lp_maxpacket(void);
  303. int lp_keepalive(void);
  304. int lp_passwordlevel(void);
  305. int lp_usernamelevel(void);
  306. int lp_readsize(void);
  307. int lp_shmem_size(void);
  308. int lp_deadtime(void);
  309. int lp_maxprotocol(void);
  310. int lp_security(void);
  311. int lp_maxdisksize(void);
  312. int lp_lpqcachetime(void);
  313. int lp_syslog(void);
  314. int lp_client_code_page(void);
  315. int lp_announce_as(void);
  316. int lp_lm_announce(void);
  317. int lp_lm_interval(void);
  318. char *lp_preexec(int );
  319. char *lp_postexec(int );
  320. char *lp_rootpreexec(int );
  321. char *lp_rootpostexec(int );
  322. char *lp_servicename(int );
  323. char *lp_pathname(int );
  324. char *lp_dontdescend(int );
  325. char *lp_username(int );
  326. char *lp_guestaccount(int );
  327. char *lp_invalid_users(int );
  328. char *lp_valid_users(int );
  329. char *lp_admin_users(int );
  330. char *lp_printcommand(int );
  331. char *lp_lpqcommand(int );
  332. char *lp_lprmcommand(int );
  333. char *lp_lppausecommand(int );
  334. char *lp_lpresumecommand(int );
  335. char *lp_queuepausecommand(int );
  336. char *lp_queueresumecommand(int );
  337. char *lp_printername(int );
  338. char *lp_printerdriver(int );
  339. char *lp_hostsallow(int );
  340. char *lp_hostsdeny(int );
  341. char *lp_magicscript(int );
  342. char *lp_magicoutput(int );
  343. char *lp_comment(int );
  344. char *lp_force_user(int );
  345. char *lp_force_group(int );
  346. char *lp_readlist(int );
  347. char *lp_writelist(int );
  348. char *lp_volume(int );
  349. char *lp_mangled_map(int );
  350. char *lp_veto_files(int );
  351. char *lp_hide_files(int );
  352. char *lp_veto_oplocks(int );
  353. char *lp_driverlocation(int );
  354. BOOL lp_alternate_permissions(int );
  355. BOOL lp_revalidate(int );
  356. BOOL lp_casesensitive(int );
  357. BOOL lp_preservecase(int );
  358. BOOL lp_shortpreservecase(int );
  359. BOOL lp_casemangle(int );
  360. BOOL lp_status(int );
  361. BOOL lp_hide_dot_files(int );
  362. BOOL lp_browseable(int );
  363. BOOL lp_readonly(int );
  364. BOOL lp_no_set_dir(int );
  365. BOOL lp_guest_ok(int );
  366. BOOL lp_guest_only(int );
  367. BOOL lp_print_ok(int );
  368. BOOL lp_postscript(int );
  369. BOOL lp_map_hidden(int );
  370. BOOL lp_map_archive(int );
  371. BOOL lp_locking(int );
  372. BOOL lp_strict_locking(int );
  373. BOOL lp_share_modes(int );
  374. BOOL lp_oplocks(int );
  375. BOOL lp_onlyuser(int );
  376. BOOL lp_manglednames(int );
  377. BOOL lp_widelinks(int );
  378. BOOL lp_symlinks(int );
  379. BOOL lp_syncalways(int );
  380. BOOL lp_strict_sync(int );
  381. BOOL lp_map_system(int );
  382. BOOL lp_delete_readonly(int );
  383. BOOL lp_fake_oplocks(int );
  384. BOOL lp_recursive_veto_delete(int );
  385. BOOL lp_dos_filetimes(int );
  386. BOOL lp_dos_filetime_resolution(int );
  387. BOOL lp_fake_dir_create_times(int );
  388. int lp_create_mode(int );
  389. int lp_force_create_mode(int );
  390. int lp_dir_mode(int );
  391. int lp_force_dir_mode(int );
  392. int lp_max_connections(int );
  393. int lp_defaultcase(int );
  394. int lp_minprintspace(int );
  395. int lp_printing(int );
  396. char lp_magicchar(int );
  397. BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
  398. int lp_add_service(char *pszService, int iDefaultService);
  399. BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
  400. BOOL lp_file_list_changed(void);
  401. BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue);
  402. int lp_next_parameter(int snum, int *i, char *label, 
  403.                char *value, int allparameters);
  404. BOOL lp_snum_ok(int iService);
  405. BOOL lp_loaded(void);
  406. void lp_killunused(BOOL (*snumused)(int ));
  407. BOOL lp_load(char *pszFname,BOOL global_only);
  408. int lp_numservices(void);
  409. void lp_dump(FILE *f);
  410. int lp_servicenumber(char *pszServiceName);
  411. char *volume_label(int snum);
  412. void lp_rename_service(int snum, char *new_name);
  413. void lp_remove_service(int snum);
  414. void lp_copy_service(int snum, char *new_name);
  415. int lp_default_server_announce(void);
  416. int lp_major_announce_version(void);
  417. int lp_minor_announce_version(void);
  418. void lp_set_name_resolve_order(char *new_order);
  419.  
  420. /*The following definitions come from  locking.c  */
  421.  
  422. BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset,int lock_type);
  423. BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int lock_type,
  424.              int *eclass,uint32 *ecode);
  425. BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode);
  426. BOOL locking_init(int read_only);
  427. BOOL locking_end(void);
  428. BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok);
  429. BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token);
  430. int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, 
  431.             share_mode_entry **shares);
  432. void del_share_mode(int token, int fnum);
  433. BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type);
  434. BOOL remove_share_oplock(int fnum, int token);
  435. int share_mode_forall(void (*fn)(share_mode_entry *, char *));
  436. void share_status(FILE *f);
  437.  
  438. /*The following definitions come from  locking_shm.c  */
  439.  
  440. struct share_ops *locking_shm_init(int ronly);
  441.  
  442. /*The following definitions come from  locking_slow.c  */
  443.  
  444. struct share_ops *locking_slow_init(int ronly);
  445.  
  446. /*The following definitions come from  mangle.c  */
  447.  
  448. int str_checksum(char *s);
  449. BOOL is_8_3(char *fname, BOOL check_case);
  450. void reset_mangled_stack( int size );
  451. BOOL check_mangled_stack(char *s);
  452. BOOL is_mangled( char *s );
  453. void mangle_name_83(char *s, int s_len);
  454. BOOL name_map_mangle(char *OutName,BOOL need83,int snum);
  455.  
  456. /*The following definitions come from  md4.c  */
  457.  
  458. void mdfour(unsigned char *out, unsigned char *in, int n);
  459.  
  460. /*The following definitions come from  mem_man/mem_man.c  */
  461.  
  462. void *smb_mem_malloc(size_t size,char *file,int line);
  463. char *smb_mem_strdup(char *s, char *file, int line);
  464. int smb_mem_free(void *ptr,char *file,int line);
  465. void smb_mem_write_info(void *ptr,FILE *outfile);
  466. char *smb_mem_query_file(void *ptr);
  467. int smb_mem_query_line(void *ptr);
  468. int smb_mem_test(void *ptr);
  469. void smb_mem_write_status(FILE *outfile);
  470. void smb_mem_write_verbose(FILE *outfile);
  471. void smb_mem_write_errors(FILE *outfile);
  472. void smb_mem_set_multiplier(int multiplier);
  473. void *smb_mem_resize(void *ptr,size_t newsize);
  474.  
  475. /*The following definitions come from  message.c  */
  476.  
  477. int reply_sends(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  478. int reply_sendstrt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  479. int reply_sendtxt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  480. int reply_sendend(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  481.  
  482. /*The following definitions come from  namequery.c  */
  483.  
  484. BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
  485.          struct in_addr to_ip,char *master,char *rname,
  486.          void (*fn)(struct packet_struct *));
  487. struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse,
  488.          struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *));
  489. FILE *startlmhosts(char *fname);
  490. BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr);
  491. void endlmhosts(FILE *fp);
  492. BOOL resolve_name(char *name, struct in_addr *return_ip);
  493.  
  494. /*The following definitions come from  nmbd.c  */
  495.  
  496. BOOL reload_services(BOOL test);
  497. int main(int argc,char *argv[]);
  498.  
  499. /*The following definitions come from  nmbd_become_dmb.c  */
  500.  
  501. void unbecome_domain_master(char *workgroup_name);
  502. void add_domain_names(time_t t);
  503.  
  504. /*The following definitions come from  nmbd_become_lmb.c  */
  505.  
  506. void insert_permanent_name_into_unicast( struct subnet_record *subrec, 
  507.                                                 struct nmb_name *nmbname, uint16 nb_type );
  508. void unbecome_local_master_success(struct subnet_record *subrec,
  509.                              struct userdata_struct *userdata,
  510.                              struct nmb_name *released_name,
  511.                              struct in_addr released_ip);
  512. void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec,
  513.                        struct nmb_name *fail_name);
  514. void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work,
  515.                                    BOOL force_new_election);
  516. void become_local_master_browser(struct subnet_record *subrec, struct work_record *work);
  517. void set_workgroup_local_master_browser_name( struct work_record *work, char *newname);
  518.  
  519. /*The following definitions come from  nmbd_browserdb.c  */
  520.  
  521. void remove_lmb_browser_entry(struct browse_cache_record *browc);
  522. void update_browser_death_time(struct browse_cache_record *browc);
  523. struct browse_cache_record *create_browser_in_lmb_cache(char *work_name, char *browser_name, 
  524.                                                         struct in_addr ip);
  525. struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name );
  526. void expire_lmb_browsers(time_t t);
  527. void remove_workgroup_lmb_browsers(char *work_group);
  528.  
  529. /*The following definitions come from  nmbd_browsesync.c  */
  530.  
  531. void dmb_expire_and_sync_browser_lists(time_t t);
  532. void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec,
  533.                                                    struct work_record *work);
  534. void collect_all_workgroup_names_from_wins_server(time_t t);
  535.  
  536. /*The following definitions come from  nmbd_elections.c  */
  537.  
  538. void check_master_browser_exists(time_t t);
  539. void run_elections(time_t t);
  540. void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf);
  541. BOOL check_elections(void);
  542.  
  543. /*The following definitions come from  nmbd_incomingdgrams.c  */
  544.  
  545. void tell_become_backup(void);
  546. void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
  547. void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
  548. void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
  549. void process_master_browser_announce(struct subnet_record *subrec, 
  550.                                      struct packet_struct *p,char *buf);
  551. void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf);
  552. void process_get_backup_list_request(struct subnet_record *subrec,
  553.                                      struct packet_struct *p,char *buf);
  554. void process_reset_browser(struct subnet_record *subrec,
  555.                                   struct packet_struct *p,char *buf);
  556. void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
  557. void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf);
  558.  
  559. /*The following definitions come from  nmbd_incomingrequests.c  */
  560.  
  561. void process_name_release_request(struct subnet_record *subrec, 
  562.                                   struct packet_struct *p);
  563. void process_name_refresh_request(struct subnet_record *subrec,
  564.                                   struct packet_struct *p);
  565. void process_name_registration_request(struct subnet_record *subrec, 
  566.                                        struct packet_struct *p);
  567. void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p);
  568. void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p);
  569.  
  570. /*The following definitions come from  nmbd_lmhosts.c  */
  571.  
  572. void load_lmhosts_file(char *fname);
  573. BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp);
  574.  
  575. /*The following definitions come from  nmbd_logonnames.c  */
  576.  
  577. void add_logon_names(void);
  578.  
  579. /*The following definitions come from  nmbd_mynames.c  */
  580.  
  581. BOOL register_my_workgroup_and_names(void);
  582. void release_my_names(void);
  583. void refresh_my_names(time_t t);
  584.  
  585. /*The following definitions come from  nmbd_namelistdb.c  */
  586.  
  587. void set_samba_nb_type(void);
  588. BOOL ms_browser_name(char *name, int type);
  589. void remove_name_from_namelist(struct subnet_record *subrec, 
  590.                                struct name_record *namerec);
  591. struct name_record *find_name_on_subnet(struct subnet_record *subrec,
  592.                                       struct nmb_name *nmbname, BOOL self_only);
  593. struct name_record *find_name_for_remote_broadcast_subnet( struct nmb_name *nmbname, 
  594.                                                            BOOL self_only);
  595. void update_name_ttl(struct name_record *namerec, int ttl);
  596. struct name_record *add_name_to_subnet(struct subnet_record *subrec,
  597.         char *name, int type, uint16 nb_flags, int ttl, 
  598.                 enum name_source source, int num_ips, struct in_addr *iplist);
  599. void standard_success_register(struct subnet_record *subrec, 
  600.                              struct userdata_struct *userdata,
  601.                              struct nmb_name *nmbname, uint16 nb_flags, int ttl,
  602.                              struct in_addr registered_ip);
  603. void standard_fail_register(struct subnet_record *subrec, 
  604.                              struct response_record *rrec, struct nmb_name *nmbname);
  605. BOOL find_ip_in_name_record(struct name_record *namerec, struct in_addr ip);
  606. void add_ip_to_name_record(struct name_record *namerec, struct in_addr new_ip);
  607. void remove_ip_from_name_record( struct name_record *namerec, struct in_addr remove_ip);
  608. void standard_success_release(struct subnet_record *subrec, 
  609.                              struct userdata_struct *userdata,
  610.                              struct nmb_name *nmbname, struct in_addr released_ip);
  611. void expire_names_on_subnet(struct subnet_record *subrec, time_t t);
  612. void expire_names(time_t t);
  613. void add_samba_names_to_subnet(struct subnet_record *subrec);
  614. void dump_all_namelists(void);
  615.  
  616. /*The following definitions come from  nmbd_namequery.c  */
  617.  
  618. BOOL query_name(struct subnet_record *subrec, char *name, int type,
  619.                    query_name_success_function success_fn,
  620.                    query_name_fail_function fail_fn, 
  621.                    struct userdata_struct *userdata);
  622. BOOL query_name_from_wins_server(struct in_addr ip_to, 
  623.                    char *name, int type,
  624.                    query_name_success_function success_fn,
  625.                    query_name_fail_function fail_fn, 
  626.                    struct userdata_struct *userdata);
  627.  
  628. /*The following definitions come from  nmbd_nameregister.c  */
  629.  
  630. BOOL register_name(struct subnet_record *subrec,
  631.                    char *name, int type, uint16 nb_flags,
  632.                    register_name_success_function success_fn,
  633.                    register_name_fail_function fail_fn,
  634.                    struct userdata_struct *userdata);
  635. BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec,
  636.                   refresh_name_success_function success_fn,
  637.                   refresh_name_fail_function fail_fn,
  638.                   struct userdata_struct *userdata);
  639.  
  640. /*The following definitions come from  nmbd_namerelease.c  */
  641.  
  642. BOOL release_name(struct subnet_record *subrec, struct name_record *namerec,
  643.                    release_name_success_function success_fn,
  644.                    release_name_fail_function fail_fn,
  645.                    struct userdata_struct *userdata);
  646.  
  647. /*The following definitions come from  nmbd_nodestatus.c  */
  648.  
  649. BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname,
  650.                  struct in_addr send_ip, node_status_success_function success_fn, 
  651.                  node_status_fail_function fail_fn, struct userdata_struct *userdata);
  652.  
  653. /*The following definitions come from  nmbd_packets.c  */
  654.  
  655. uint16 get_nb_flags(char *buf);
  656. void set_nb_flags(char *buf, uint16 nb_flags);
  657. struct response_record *queue_register_name( struct subnet_record *subrec,
  658.                           response_function resp_fn,
  659.                           timeout_response_function timeout_fn,
  660.                           register_name_success_function success_fn,
  661.                           register_name_fail_function fail_fn,
  662.                           struct userdata_struct *userdata,
  663.                           struct nmb_name *nmbname,
  664.                           uint16 nb_flags);
  665. struct response_record *queue_register_multihomed_name( struct subnet_record *subrec,
  666.                           response_function resp_fn,
  667.                           timeout_response_function timeout_fn,
  668.                           register_name_success_function success_fn,
  669.                           register_name_fail_function fail_fn,
  670.                           struct userdata_struct *userdata,
  671.                           struct nmb_name *nmbname,
  672.                           uint16 nb_flags,
  673.                           struct in_addr register_ip);
  674. struct response_record *queue_release_name( struct subnet_record *subrec,
  675.                           response_function resp_fn,
  676.                           timeout_response_function timeout_fn,
  677.                           release_name_success_function success_fn,
  678.                           release_name_fail_function fail_fn,
  679.                           struct userdata_struct *userdata,
  680.                           struct nmb_name *nmbname,
  681.                           uint16 nb_flags,
  682.                           struct in_addr release_ip);
  683. struct response_record *queue_refresh_name( struct subnet_record *subrec,
  684.                           response_function resp_fn,
  685.                           timeout_response_function timeout_fn,
  686.                           refresh_name_success_function success_fn,
  687.                           refresh_name_fail_function fail_fn,
  688.                           struct userdata_struct *userdata,
  689.                           struct name_record *namerec,
  690.                           struct in_addr refresh_ip);
  691. struct response_record *queue_query_name( struct subnet_record *subrec,
  692.                           response_function resp_fn,
  693.                           timeout_response_function timeout_fn,
  694.                           query_name_success_function success_fn,
  695.                           query_name_fail_function fail_fn,
  696.                           struct userdata_struct *userdata,
  697.                           struct nmb_name *nmbname);
  698. struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip,
  699.                           response_function resp_fn,
  700.                           timeout_response_function timeout_fn,
  701.                           query_name_success_function success_fn,
  702.                           query_name_fail_function fail_fn,
  703.                           struct userdata_struct *userdata,
  704.                           struct nmb_name *nmbname);
  705. struct response_record *queue_node_status( struct subnet_record *subrec,
  706.                           response_function resp_fn,
  707.                           timeout_response_function timeout_fn,
  708.                           node_status_success_function success_fn,
  709.                           node_status_fail_function fail_fn,
  710.                           struct userdata_struct *userdata,
  711.                           struct nmb_name *nmbname,
  712.                           struct in_addr send_ip);
  713. void reply_netbios_packet(struct packet_struct *orig_packet,
  714.                           int rcode, enum netbios_reply_type_code rcv_code, int opcode,
  715.                           int ttl, char *data,int len);
  716. void queue_packet(struct packet_struct *packet);
  717. void process_browse_packet(struct packet_struct *p, char *buf,int len);
  718. void process_lanman_packet(struct packet_struct *p, char *buf,int len);
  719. BOOL validate_nmb_response_packet( struct nmb_packet *nmb );
  720. BOOL validate_nmb_packet( struct nmb_packet *nmb );
  721. void run_packet_queue(void);
  722. void retransmit_or_expire_response_records(time_t t);
  723. BOOL listen_for_packets(BOOL run_election);
  724. BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len,
  725.                    char *srcname, int src_type,
  726.                    char *dstname, int dest_type,
  727.                    struct in_addr dest_ip,struct in_addr src_ip);
  728.  
  729. /*The following definitions come from  nmbd_processlogon.c  */
  730.  
  731. void process_logon_packet(struct packet_struct *p,char *buf,int len, 
  732.                           char *mailslot);
  733.  
  734. /*The following definitions come from  nmbd_responserecordsdb.c  */
  735.  
  736. void add_response_record(struct subnet_record *subrec,
  737.                 struct response_record *rrec);
  738. void remove_response_record(struct subnet_record *subrec,
  739.                 struct response_record *rrec);
  740. struct response_record *make_response_record( struct subnet_record *subrec,
  741.                     struct packet_struct *p,
  742.                     response_function resp_fn,
  743.                     timeout_response_function timeout_fn,
  744.                     success_function success_fn,
  745.                     fail_function fail_fn,
  746.                     struct userdata_struct *userdata);
  747. struct response_record *find_response_record(struct subnet_record **ppsubrec,
  748.                 uint16 id);
  749. BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec);
  750.  
  751. /*The following definitions come from  nmbd_sendannounce.c  */
  752.  
  753. void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip);
  754. void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work);
  755. void announce_my_server_names(time_t t);
  756. void announce_my_lm_server_names(time_t t);
  757. void reset_announce_timer(void);
  758. void announce_myself_to_domain_master_browser(time_t t);
  759. void announce_my_servers_removed(void);
  760. void announce_remote(time_t t);
  761. void browse_sync_remote(time_t t);
  762.  
  763. /*The following definitions come from  nmbd_serverlistdb.c  */
  764.  
  765. void remove_all_servers(struct work_record *work);
  766. struct server_record *find_server_in_workgroup(struct work_record *work, char *name);
  767. void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec);
  768. struct server_record *create_server_on_workgroup(struct work_record *work,
  769.                                                  char *name,int servertype, 
  770.                                                  int ttl,char *comment);
  771. void update_server_ttl(struct server_record *servrec, int ttl);
  772. void expire_servers(struct work_record *work, time_t t);
  773. void write_browse_list(time_t t, BOOL force_write);
  774.  
  775. /*The following definitions come from  nmbd_subnetdb.c  */
  776.  
  777. BOOL create_subnets(void);
  778. BOOL we_are_a_wins_client(void);
  779. struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec);
  780. struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec);
  781.  
  782. /*The following definitions come from  nmbd_winsproxy.c  */
  783.  
  784. void make_wins_proxy_name_query_request( struct subnet_record *subrec, 
  785.                                          struct packet_struct *incoming_packet,
  786.                                          struct nmb_name *question_name);
  787.  
  788. /*The following definitions come from  nmbd_winsserver.c  */
  789.  
  790. BOOL packet_is_for_wins_server(struct packet_struct *packet);
  791. BOOL initialise_wins(void);
  792. void wins_process_name_refresh_request(struct subnet_record *subrec,
  793.                                             struct packet_struct *p);
  794. void wins_process_name_registration_request(struct subnet_record *subrec,
  795.                                             struct packet_struct *p);
  796. void wins_process_multihomed_name_registration_request( struct subnet_record *subrec,
  797.                                                         struct packet_struct *p);
  798. void send_wins_name_query_response(int rcode, struct packet_struct *p, 
  799.                                           struct name_record *namerec);
  800. void wins_process_name_query_request(struct subnet_record *subrec, 
  801.                                      struct packet_struct *p);
  802. void wins_process_name_release_request(struct subnet_record *subrec,
  803.                                        struct packet_struct *p);
  804. void initiate_wins_processing(time_t t);
  805. void wins_write_database(void);
  806.  
  807. /*The following definitions come from  nmbd_workgroupdb.c  */
  808.  
  809. struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, 
  810.                                              fstring name);
  811. struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec,
  812.                                                fstring name, int ttl);
  813. void update_workgroup_ttl(struct work_record *work, int ttl);
  814. void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work);
  815. void dump_workgroups(BOOL force_write);
  816. void expire_workgroups_and_servers(time_t t);
  817.  
  818. /*The following definitions come from  nmblib.c  */
  819.  
  820. char *lookup_opcode_name( int opcode );
  821. void debug_nmb_packet(struct packet_struct *p);
  822. char *namestr(struct nmb_name *n);
  823. struct packet_struct *copy_packet(struct packet_struct *packet);
  824. void free_packet(struct packet_struct *packet);
  825. struct packet_struct *read_packet(int fd,enum packet_type packet_type);
  826. void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope);
  827. BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
  828. BOOL send_packet(struct packet_struct *p);
  829. struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
  830.  
  831. /*The following definitions come from  ntclient.c  */
  832.  
  833. BOOL do_nt_login(char *desthost, char *myhostname,
  834.                 int Client, int cnum);
  835.  
  836. /*The following definitions come from  params.c  */
  837.  
  838. BOOL pm_process( char *FileName,
  839.                  BOOL (*sfunc)(char *),
  840.                  BOOL (*pfunc)(char *, char *) );
  841.  
  842. /*The following definitions come from  password.c  */
  843.  
  844. void generate_next_challenge(char *challenge);
  845. BOOL set_challenge(char *challenge);
  846. BOOL last_challenge(char *challenge);
  847. user_struct *get_valid_user_struct(uint16 vuid);
  848. void invalidate_vuid(uint16 vuid);
  849. char *validated_username(uint16 vuid);
  850. uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest);
  851. void add_session_user(char *user);
  852. BOOL update_smbpassword_file( struct passwd *pass, fstring password);
  853. void dfs_unlogin(void);
  854. BOOL password_check(char *password);
  855. BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8);
  856. BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd);
  857. BOOL user_ok(char *user,int snum);
  858. BOOL authorise_login(int snum,char *user,char *password, int pwlen, 
  859.              BOOL *guest,BOOL *force,uint16 vuid);
  860. BOOL check_hosts_equiv(char *user);
  861. struct cli_state *server_client(void);
  862. struct cli_state *server_cryptkey(void);
  863. BOOL server_validate(char *user, char *domain, 
  864.              char *pass, int passlen,
  865.              char *ntpass, int ntpasslen);
  866.  
  867. /*The following definitions come from  pcap.c  */
  868.  
  869. BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname);
  870. void pcap_printer_fn(void (*fn)(char *, char*));
  871.  
  872. /*The following definitions come from  pipes.c  */
  873.  
  874. int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize);
  875. int reply_pipe_close(char *inbuf,char *outbuf);
  876. BOOL api_LsarpcSNPHS(int pnum, int cnum, char *param);
  877. BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data,
  878.              int mdrcnt,int mprcnt,
  879.              char **rdata,char **rparam,
  880.              int *rdata_len,int *rparam_len);
  881.  
  882. /*The following definitions come from  predict.c  */
  883.  
  884. int read_predict(int fd,int offset,char *buf,char **ptr,int num);
  885. void do_read_prediction(void);
  886. void invalidate_read_prediction(int fd);
  887.  
  888. /*The following definitions come from  print_svid.c  */
  889.  
  890. void sysv_printer_fn(void (*fn)(char *, char *));
  891. int sysv_printername_ok(char *name);
  892.  
  893. /*The following definitions come from  printing.c  */
  894.  
  895. void lpq_reset(int snum);
  896. void print_file(int fnum);
  897. int get_printqueue(int snum,int cnum,print_queue_struct **queue,
  898.            print_status_struct *status);
  899. void del_printqueue(int cnum,int snum,int jobid);
  900. void status_printjob(int cnum,int snum,int jobid,int status);
  901. int printjob_encode(int snum, int job);
  902. void printjob_decode(int jobid, int *snum, int *job);
  903. void status_printqueue(int cnum,int snum,int status);
  904.  
  905. /*The following definitions come from  quotas.c  */
  906.  
  907. BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
  908. BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
  909. BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
  910. BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
  911. BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
  912. BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
  913.  
  914. /*The following definitions come from  replace.c  */
  915.  
  916. char *Strstr(char *s, char *p);
  917. time_t Mktime(struct tm      *t);
  918. int InNetGr(char *group,char *host,char *user,char *dom);
  919. void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
  920.  
  921. /*The following definitions come from  reply.c  */
  922.  
  923. int reply_special(char *inbuf,char *outbuf);
  924. int reply_tcon(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  925. int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
  926. int reply_unknown(char *inbuf,char *outbuf);
  927. int reply_ioctl(char *inbuf,char *outbuf, int size, int bufsize);
  928. int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize);
  929. int reply_chkpth(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  930. int reply_getatr(char *inbuf,char *outbuf, int in_size, int buffsize);
  931. int reply_setatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  932. int reply_dskattr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  933. int reply_search(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  934. int reply_fclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  935. int reply_open(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  936. int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize);
  937. int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize);
  938. int reply_mknew(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  939. int reply_ctemp(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  940. int reply_unlink(char *inbuf,char *outbuf, int dum_size, int dum_bufsize);
  941. int reply_readbraw(char *inbuf, char *outbuf, int dum_size, int dum_buffsize);
  942. int reply_lockread(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  943. int reply_read(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  944. int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
  945. int reply_writebraw(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  946. int reply_writeunlock(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  947. int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
  948. int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
  949. int reply_lseek(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  950. int reply_flush(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  951. int reply_exit(char *inbuf,char *outbuf, int size, int bufsize);
  952. int reply_close(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  953. int reply_writeclose(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  954. int reply_lock(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  955. int reply_unlock(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  956. int reply_tdis(char *inbuf,char *outbuf, int size, int bufsize);
  957. int reply_echo(char *inbuf,char *outbuf, int size, int bufsize);
  958. int reply_printopen(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  959. int reply_printclose(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  960. int reply_printqueue(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  961. int reply_printwrite(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  962. int reply_mkdir(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  963. int reply_rmdir(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  964. int reply_mv(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  965. int reply_copy(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  966. int reply_setdir(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  967. int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
  968. int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
  969. int reply_writebmpx(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  970. int reply_writebs(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  971. int reply_setattrE(char *inbuf,char *outbuf,int dum_size, int dum_buffsize);
  972. int reply_getattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize);
  973.  
  974. /*The following definitions come from  rpc_pipes/lsa_hnd.c  */
  975.  
  976. void init_lsa_policy_hnd(void);
  977. BOOL open_lsa_policy_hnd(LSA_POL_HND *hnd);
  978. BOOL set_lsa_policy_samr_rid(LSA_POL_HND *hnd, uint32 rid);
  979. BOOL set_lsa_policy_samr_pol_status(LSA_POL_HND *hnd, uint32 pol_status);
  980. BOOL set_lsa_policy_samr_sid(LSA_POL_HND *hnd, DOM_SID *sid);
  981. uint32 get_lsa_policy_samr_rid(LSA_POL_HND *hnd);
  982. BOOL close_lsa_policy_hnd(LSA_POL_HND *hnd);
  983.  
  984. /*The following definitions come from  rpc_pipes/lsaparse.c  */
  985.  
  986. void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name,
  987.             uint32 attributes, uint32 sec_qos,
  988.             uint16 desired_access);
  989. char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int align, int depth);
  990. char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth);
  991. void make_q_query(LSA_Q_QUERY_INFO *q_q, LSA_POL_HND *hnd, uint16 info_class);
  992. char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth);
  993. char* lsa_io_q_enum_trust_dom(BOOL io, LSA_Q_ENUM_TRUST_DOM *q_e, char *q, char *base, int align, int depth);
  994. void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, LSA_POL_HND *hnd, uint32 status);
  995. char* lsa_io_r_enum_trust_dom(BOOL io, LSA_R_ENUM_TRUST_DOM *r_e, char *q, char *base, int align, int depth);
  996. void make_q_close(LSA_Q_CLOSE *q_c, LSA_POL_HND *hnd);
  997. char* lsa_io_q_close(BOOL io, LSA_Q_CLOSE *q_c, char *q, char *base, int align, int depth);
  998. void make_r_close(LSA_R_CLOSE *q_r, LSA_POL_HND *hnd);
  999. char* lsa_io_r_close(BOOL io, LSA_R_CLOSE *r_c, char *q, char *base, int align, int depth);
  1000. char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth);
  1001. char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth);
  1002. char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth);
  1003. char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth);
  1004. char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth);
  1005. void make_q_req_chal(LSA_Q_REQ_CHAL *q_c,
  1006.                 char *logon_srv, char *logon_clnt,
  1007.                 DOM_CHAL *clnt_chal);
  1008. char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth);
  1009. char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth);
  1010. void make_q_auth_2(LSA_Q_AUTH_2 *q_a,
  1011.         char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
  1012.         DOM_CHAL *clnt_chal, uint32 clnt_flgs);
  1013. char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth);
  1014. char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth);
  1015. void make_q_srv_pwset(LSA_Q_SRV_PWSET *q_s, char sess_key[8],
  1016.         char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
  1017.         DOM_CRED *cred, char nt_cypher[16]);
  1018. char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth);
  1019. char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth);
  1020. char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth);
  1021. char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align, int depth);
  1022. char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align, int depth);
  1023. char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align, int depth);
  1024. char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align, int depth);
  1025.  
  1026. /*The following definitions come from  rpc_pipes/ntclientlsa.c  */
  1027.  
  1028. BOOL do_lsa_open_policy(uint16 fnum, uint32 call_id,
  1029.             char *server_name, LSA_POL_HND *hnd);
  1030. BOOL do_lsa_query_info_pol(uint16 fnum, uint32 call_id,
  1031.             LSA_POL_HND *hnd, uint16 info_class,
  1032.             fstring domain_name, pstring domain_sid);
  1033. BOOL do_lsa_close(uint16 fnum, uint32 call_id,
  1034.             LSA_POL_HND *hnd);
  1035.  
  1036. /*The following definitions come from  rpc_pipes/ntclientnet.c  */
  1037.  
  1038. BOOL do_lsa_req_chal(uint16 fnum, uint32 call_id,
  1039.         char *desthost, char *myhostname,
  1040.         DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal);
  1041. BOOL do_lsa_auth2(uint16 fnum, uint32 call_id,
  1042.         char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name,
  1043.         DOM_CHAL *clnt_chal, uint32 neg_flags, DOM_CHAL *srv_chal);
  1044. BOOL do_lsa_srv_pwset(uint16 fnum, uint32 call_id,
  1045.         uchar sess_key[8], 
  1046.         char *logon_srv, char *mach_acct, uint16 sec_chan_type, char *comp_name,
  1047.         DOM_CRED *clnt_cred, DOM_CRED *srv_cred,
  1048.         char nt_owf_new_mach_pwd[16]);
  1049. BOOL do_lsa_sam_logon(uint16 fnum, uint32 call_id,
  1050.         uchar sess_key[8], DOM_CRED *sto_clnt_cred,
  1051.         char *logon_srv, char *comp_name,
  1052.         DOM_CRED *clnt_cred, DOM_CRED *rtn_cred,
  1053.         uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1,
  1054.         LSA_USER_INFO *user_info,
  1055.         DOM_CRED *srv_cred);
  1056. BOOL do_lsa_sam_logoff(uint16 fnum, uint32 call_id,
  1057.         uchar sess_key[8], DOM_CRED *sto_clnt_cred,
  1058.         char *logon_srv, char *comp_name,
  1059.         DOM_CRED *clnt_cred, DOM_CRED *rtn_cred,
  1060.         uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1,
  1061.         DOM_CRED *srv_cred);
  1062.  
  1063. /*The following definitions come from  rpc_pipes/ntclientpipe.c  */
  1064.  
  1065. uint16 rpc_pipe_open(char *inbuf, char *outbuf, char *rname, int Client, int cnum);
  1066. BOOL rpc_pipe_set_hnd_state(char *pipe_name, uint16 fnum, uint16 device_state);
  1067. BOOL rpc_pipe_bind(char *pipe_name, uint16 fnum, uint32 call_id,
  1068.                 RPC_IFACE *abstract, RPC_IFACE *transfer);
  1069.  
  1070. /*The following definitions come from  rpc_pipes/pipe_hnd.c  */
  1071.  
  1072. void reset_chain_pnum(void);
  1073. void init_rpc_pipe_hnd(void);
  1074. int open_rpc_pipe_hnd(char *pipe_name, int cnum);
  1075. char *get_rpc_pipe_hnd_name(int pnum);
  1076. BOOL set_rpc_pipe_hnd_state(int pnum, int cnum, uint16 device_state);
  1077. BOOL close_rpc_pipe_hnd(int pnum, int cnum);
  1078. int get_rpc_pipe_num(char *buf, int where);
  1079.  
  1080. /*The following definitions come from  rpc_pipes/pipenetlog.c  */
  1081.  
  1082. BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data,
  1083.              int mdrcnt,int mprcnt,
  1084.              char **rdata,char **rparam,
  1085.              int *rdata_len,int *rparam_len);
  1086.  
  1087. /*The following definitions come from  rpc_pipes/pipentlsa.c  */
  1088.  
  1089. BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data,
  1090.              int mdrcnt,int mprcnt,
  1091.              char **rdata,char **rparam,
  1092.              int *rdata_len,int *rparam_len);
  1093.  
  1094. /*The following definitions come from  rpc_pipes/pipesamr.c  */
  1095.  
  1096. BOOL api_samrTNP(int cnum,int uid, char *param,char *data,
  1097.              int mdrcnt,int mprcnt,
  1098.              char **rdata,char **rparam,
  1099.              int *rdata_len,int *rparam_len);
  1100.  
  1101. /*The following definitions come from  rpc_pipes/pipesrvsvc.c  */
  1102.  
  1103. BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data,
  1104.              int mdrcnt,int mprcnt,
  1105.              char **rdata,char **rparam,
  1106.              int *rdata_len,int *rparam_len);
  1107.  
  1108. /*The following definitions come from  rpc_pipes/pipeutil.c  */
  1109.  
  1110. void initrpcreply(char *inbuf, char *q);
  1111. void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen);
  1112. BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid);
  1113. char *dom_sid_to_string(DOM_SID *sid);
  1114. int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids);
  1115. int make_dom_gids(char *gids_str, DOM_GID *gids);
  1116. int create_rpc_request(uint32 call_id, uint8 op_num, char *q, int data_len);
  1117. int create_rpc_reply(uint32 call_id, char *q, int data_len);
  1118.  
  1119. /*The following definitions come from  rpc_pipes/pipewkssvc.c  */
  1120.  
  1121. BOOL api_wkssvcTNP(int cnum,int uid, char *param,char *data,
  1122.              int mdrcnt,int mprcnt,
  1123.              char **rdata,char **rparam,
  1124.              int *rdata_len,int *rparam_len);
  1125.  
  1126. /*The following definitions come from  rpc_pipes/samrparse.c  */
  1127.  
  1128. char* samr_io_q_close(BOOL io, SAMR_Q_CLOSE *q_u, char *q, char *base, int align, int depth);
  1129. char* samr_io_r_close(BOOL io, SAMR_R_CLOSE *r_u, char *q, char *base, int align, int depth);
  1130. char* samr_io_q_open_secret(BOOL io, SAMR_Q_OPEN_SECRET *q_u, char *q, char *base, int align, int depth);
  1131. char* samr_io_r_open_secret(BOOL io, SAMR_R_OPEN_SECRET *r_u, char *q, char *base, int align, int depth);
  1132. char* samr_io_q_lookup_rids(BOOL io, SAMR_Q_LOOKUP_RIDS *q_u, char *q, char *base, int align, int depth);
  1133. void make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u,
  1134.         uint32 num_rids, uint32 rid, uint32 status);
  1135. char* samr_io_r_lookup_rids(BOOL io, SAMR_R_LOOKUP_RIDS *r_u, char *q, char *base, int align, int depth);
  1136. char* samr_io_q_unknown_22(BOOL io, SAMR_Q_UNKNOWN_22 *q_u, char *q, char *base, int align, int depth);
  1137. char* samr_io_r_unknown_22(BOOL io, SAMR_R_UNKNOWN_22 *r_u, char *q, char *base, int align, int depth);
  1138. char* samr_io_q_unknown_24(BOOL io, SAMR_Q_UNKNOWN_24 *q_u, char *q, char *base, int align, int depth);
  1139. void make_samr_r_unknown_24(SAMR_R_UNKNOWN_24 *r_u,
  1140.                 uint16 unknown_0, NTTIME *expiry, char *mach_acct,
  1141.                 uint32 unknown_id_0, uint32 status);
  1142. char* samr_io_r_unknown_24(BOOL io, SAMR_R_UNKNOWN_24 *r_u, char *q, char *base, int align, int depth);
  1143. char* samr_io_q_unknown_32(BOOL io, SAMR_Q_UNKNOWN_32 *q_u, char *q, char *base, int align, int depth);
  1144. char* samr_io_r_unknown_32(BOOL io, SAMR_R_UNKNOWN_32 *r_u, char *q, char *base, int align, int depth);
  1145. char* samr_io_q_open_policy(BOOL io, SAMR_Q_OPEN_POLICY *q_u, char *q, char *base, int align, int depth);
  1146. char* samr_io_r_open_policy(BOOL io, SAMR_R_OPEN_POLICY *r_u, char *q, char *base, int align, int depth);
  1147.  
  1148. /*The following definitions come from  rpc_pipes/smbparse.c  */
  1149.  
  1150. char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth);
  1151. char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align, int depth);
  1152. void make_dom_sid(DOM_SID *sid, char *domsid);
  1153. char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int depth);
  1154. void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate);
  1155. char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int depth);
  1156. void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate);
  1157. char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align, int depth);
  1158. void make_unistr(UNISTR *str, char *buf);
  1159. char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth);
  1160. void make_unistr2(UNISTR2 *str, char *buf, int len);
  1161. char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth);
  1162. void make_dom_sid2(DOM_SID2 *sid2, char *sid_str);
  1163. char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth);
  1164. void make_dom_rid2(DOM_RID2 *rid2, uint32 rid);
  1165. char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth);
  1166. void make_dom_rid3(DOM_RID3 *rid3, uint32 rid);
  1167. char* smb_io_dom_rid3(BOOL io, DOM_RID3 *rid3, char *q, char *base, int align, int depth);
  1168. void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name);
  1169. char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth);
  1170. void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name,
  1171.         uint16 sec_chan, char *comp_name);
  1172. char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth);
  1173. char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth);
  1174. char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth);
  1175. void make_clnt_info2(DOM_CLNT_INFO2 *clnt,
  1176.                 char *logon_srv, char *comp_name,
  1177.                 DOM_CRED *clnt_cred);
  1178. char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth);
  1179. char* make_clnt_info(DOM_CLNT_INFO *clnt,
  1180.         char *logon_srv, char *acct_name,
  1181.         uint16 sec_chan, char *comp_name,
  1182.                 DOM_CRED *cred);
  1183. char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth);
  1184. void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high);
  1185. char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth);
  1186. void make_arc4_owf(ARC4_OWF *hash, char data[16]);
  1187. char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth);
  1188. void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name,
  1189.                 uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
  1190.                 char *user_name, char *wksta_name,
  1191.                 char *sess_key,
  1192.                 unsigned char lm_cypher[16], unsigned char nt_cypher[16]);
  1193. char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth);
  1194. void make_sam_info(DOM_SAM_INFO *sam,
  1195.                 char *logon_srv, char *comp_name, DOM_CRED *clnt_cred,
  1196.                 DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value,
  1197.                 DOM_ID_INFO_1 *id1);
  1198. char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth);
  1199. char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth);
  1200. void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 frag,
  1201.                 uint32 call_id, int data_len);
  1202. char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth);
  1203. void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version);
  1204. char* smb_io_rpc_iface(BOOL io, RPC_IFACE *ifc, char *q, char *base, int align, int depth);
  1205. void make_rpc_addr_str(RPC_ADDR_STR *str, char *name);
  1206. char* smb_io_rpc_addr_str(BOOL io, RPC_ADDR_STR *str, char *q, char *base, int align, int depth);
  1207. void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid);
  1208. char* smb_io_rpc_hdr_bba(BOOL io, RPC_HDR_BBA *rpc, char *q, char *base, int align, int depth);
  1209. void make_rpc_hdr_rb(RPC_HDR_RB *rpc, 
  1210.                 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
  1211.                 uint32 num_elements, uint16 context_id, uint8 num_syntaxes,
  1212.                 RPC_IFACE *abstract, RPC_IFACE *transfer);
  1213. char* smb_io_rpc_hdr_rb(BOOL io, RPC_HDR_RB *rpc, char *q, char *base, int align, int depth);
  1214. void make_rpc_results(RPC_RESULTS *res, 
  1215.                 uint8 num_results, uint16 result, uint16 reason);
  1216. char* smb_io_rpc_results(BOOL io, RPC_RESULTS *res, char *q, char *base, int align, int depth);
  1217. void make_rpc_hdr_ba(RPC_HDR_BA *rpc, 
  1218.                 uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
  1219.                 char *pipe_addr,
  1220.                 uint8 num_results, uint16 result, uint16 reason,
  1221.                 RPC_IFACE *transfer);
  1222. char* smb_io_rpc_hdr_ba(BOOL io, RPC_HDR_BA *rpc, char *q, char *base, int align, int depth);
  1223. void make_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos);
  1224. char* smb_io_obj_attr(BOOL io, LSA_OBJ_ATTR *attr, char *q, char *base, int align, int depth);
  1225. void make_rpc_hdr_rr(RPC_HDR_RR *hdr, enum RPC_PKT_TYPE pkt_type,
  1226.                 uint32 call_id, int data_len, uint8 opnum);
  1227. char* smb_io_rpc_hdr_rr(BOOL io, RPC_HDR_RR *rpc, char *q, char *base, int align, int depth);
  1228. char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth);
  1229. char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth);
  1230. char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth);
  1231. char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align, int depth);
  1232. char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align, int depth);
  1233. char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align, int depth);
  1234. char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align, int depth);
  1235.  
  1236. /*The following definitions come from  rpc_pipes/srvparse.c  */
  1237.  
  1238. char* srv_io_share_info1_str(BOOL io, SH_INFO_1_STR *sh1, char *q, char *base, int align, int depth);
  1239. char* srv_io_share_info1(BOOL io, SH_INFO_1 *sh1, char *q, char *base, int align, int depth);
  1240. char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, int align, int depth);
  1241. char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth);
  1242. char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth);
  1243.  
  1244. /*The following definitions come from  rpc_pipes/wksparse.c  */
  1245.  
  1246. char* wks_io_q_unknown_0(BOOL io, WKS_Q_UNKNOWN_0 *q_u, char *q, char *base, int align, int depth);
  1247. char* wks_io_r_unknown_0(BOOL io, WKS_R_UNKNOWN_0 *r_u, char *q, char *base, int align, int depth);
  1248.  
  1249. /*The following definitions come from  server.c  */
  1250.  
  1251. void  *dflt_sig(void);
  1252. void  killkids(void);
  1253. mode_t unix_mode(int cnum,int dosmode);
  1254. int dos_mode(int cnum,char *path,struct stat *sbuf);
  1255. int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st);
  1256. int file_utime(int cnum, char *fname, struct utimbuf *times);
  1257. BOOL set_filetime(int cnum, char *fname, time_t mtime);
  1258. BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path);
  1259. int disk_free(char *path,int *bsize,int *dfree,int *dsize);
  1260. int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize);
  1261. BOOL check_name(char *name,int cnum);
  1262. void sync_file(int cnum, int fnum);
  1263. void close_file(int fnum, BOOL normal_close);
  1264. BOOL check_file_sharing(int cnum,char *fname, BOOL rename_op);
  1265. int check_share_mode( share_mode_entry *share, int deny_mode, char *fname,
  1266.                       BOOL fcbopen, int *flags);
  1267. void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
  1268.               int mode,int oplock_request, int *Access,int *action);
  1269. int seek_file(int fnum,uint32 pos);
  1270. int read_file(int fnum,char *data,uint32 pos,int n);
  1271. int write_file(int fnum,char *data,int n);
  1272. BOOL become_service(int cnum,BOOL do_chdir);
  1273. int find_service(char *service);
  1274. int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line);
  1275. int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
  1276. int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line);
  1277. BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval);
  1278. BOOL request_oplock_break(share_mode_entry *share_entry, 
  1279.                           uint32 dev, uint32 inode);
  1280. BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout);
  1281. BOOL snum_used(int snum);
  1282. BOOL reload_services(BOOL test);
  1283. int setup_groups(char *user, int uid, int gid, int *p_ngroups, 
  1284.          int **p_igroups, gid_t **p_groups,
  1285.          int **p_attrs);
  1286. int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid);
  1287. int find_free_file(void );
  1288. int reply_corep(char *outbuf);
  1289. int reply_coreplus(char *outbuf);
  1290. int reply_lanman1(char *outbuf);
  1291. int reply_lanman2(char *outbuf);
  1292. int reply_nt1(char *outbuf);
  1293. void close_cnum(int cnum, uint16 vuid);
  1294. BOOL yield_connection(int cnum,char *name,int max_connections);
  1295. BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear);
  1296. void exit_server(char *reason);
  1297. void standard_sub(int cnum,char *str);
  1298. char *smb_fn_name(int type);
  1299. int chain_reply(char *inbuf,char *outbuf,int size,int bufsize);
  1300. int construct_reply(char *inbuf,char *outbuf,int size,int bufsize);
  1301.  
  1302. /*The following definitions come from  shmem.c  */
  1303.  
  1304. struct shmem_ops *smb_shm_open(int ronly);
  1305.  
  1306. /*The following definitions come from  shmem_sysv.c  */
  1307.  
  1308. struct shmem_ops *sysv_shm_open(int ronly);
  1309.  
  1310. /*The following definitions come from  slprintf.c  */
  1311.  
  1312. int vslprintf(char *str, int n, char *format, va_list ap);
  1313.  
  1314. /*The following definitions come from  smbdes.c  */
  1315.  
  1316. void E_P16(unsigned char *p14,unsigned char *p16);
  1317. void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
  1318. void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out);
  1319. void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out);
  1320. void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key);
  1321. void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key);
  1322. void SamOEMhash( unsigned char *data, unsigned char *key, int val);
  1323.  
  1324. /*The following definitions come from  smbencrypt.c  */
  1325.  
  1326. void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24);
  1327. void E_md4hash(uchar *passwd, uchar *p16);
  1328. void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24);
  1329. void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16);
  1330.  
  1331. /*The following definitions come from  smberr.c  */
  1332.  
  1333. char *smb_errstr(char *inbuf);
  1334.  
  1335. /*The following definitions come from  smbpass.c  */
  1336.  
  1337. int pw_file_lock(char *name, int type, int secs);
  1338. int pw_file_unlock(int fd);
  1339. struct smb_passwd *get_smbpwd_entry(char *name, int smb_userid);
  1340. BOOL add_smbpwd_entry(struct smb_passwd* pwd);
  1341. BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override);
  1342.  
  1343. /*The following definitions come from  status.c  */
  1344.  
  1345. void Ucrit_addUsername(pstring username);
  1346. unsigned int Ucrit_checkUsername(pstring username);
  1347. void Ucrit_addPid(int pid);
  1348. unsigned int   Ucrit_checkPid(int pid);
  1349.  
  1350. /*The following definitions come from  system.c  */
  1351.  
  1352. int sys_select(fd_set *fds,struct timeval *tval);
  1353. int sys_select(fd_set *fds,struct timeval *tval);
  1354. int sys_unlink(char *fname);
  1355. int sys_open(char *fname,int flags,int mode);
  1356. DIR *sys_opendir(char *dname);
  1357. int sys_stat(char *fname,struct stat *sbuf);
  1358. int sys_waitpid(pid_t pid,int *status,int options);
  1359. int sys_lstat(char *fname,struct stat *sbuf);
  1360. int sys_mkdir(char *dname,int mode);
  1361. int sys_rmdir(char *dname);
  1362. int sys_chdir(char *dname);
  1363. int sys_utime(char *fname,struct utimbuf *times);
  1364. int sys_rename(char *from, char *to);
  1365. int sys_chmod(char *fname,int mode);
  1366. char *sys_getwd(char *s);
  1367. int sys_chown(char *fname,int uid,int gid);
  1368. int sys_chroot(char *dname);
  1369. struct hostent *sys_gethostbyname(char *name);
  1370.  
  1371. /*The following definitions come from  time.c  */
  1372.  
  1373. void GetTimeOfDay(struct timeval *tval);
  1374. void TimeInit(void);
  1375. int TimeDiff(time_t t);
  1376. struct tm *LocalTime(time_t *t);
  1377. time_t interpret_long_date(char *p);
  1378. void put_long_date(char *p,time_t t);
  1379. BOOL null_mtime(time_t mtime);
  1380. void put_dos_date(char *buf,int offset,time_t unixdate);
  1381. void put_dos_date2(char *buf,int offset,time_t unixdate);
  1382. void put_dos_date3(char *buf,int offset,time_t unixdate);
  1383. time_t make_unix_date(void *date_ptr);
  1384. time_t make_unix_date2(void *date_ptr);
  1385. time_t make_unix_date3(void *date_ptr);
  1386. char *timestring(void );
  1387. time_t get_create_time(struct stat *st,BOOL fake_dirs);
  1388.  
  1389. /*The following definitions come from  trans2.c  */
  1390.  
  1391. void mask_convert( char *mask);
  1392. int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
  1393. int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
  1394. int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
  1395. int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize);
  1396.  
  1397. /*The following definitions come from  ubiqx/ubi_dLinkList.c  */
  1398.  
  1399.  
  1400. /*The following definitions come from  ufc.c  */
  1401.  
  1402. char *ufc_crypt(char *key,char *salt);
  1403.  
  1404. /*The following definitions come from  uid.c  */
  1405.  
  1406. void init_uid(void);
  1407. BOOL become_guest(void);
  1408. BOOL become_user(connection_struct *conn, int cnum, uint16 vuid);
  1409. BOOL unbecome_user(void );
  1410. int smbrun(char *cmd,char *outfile,BOOL shared);
  1411. void become_root(BOOL save_dir) ;
  1412. void unbecome_root(BOOL restore_dir);
  1413.  
  1414. /*The following definitions come from  username.c  */
  1415.  
  1416. char *get_home_dir(char *user);
  1417. BOOL map_username(char *user);
  1418. struct passwd *Get_Pwnam(char *user,BOOL allow_change);
  1419. BOOL user_in_list(char *user,char *list);
  1420.  
  1421. /*The following definitions come from  util.c  */
  1422.  
  1423. int sig_usr2(void);
  1424. int sig_usr1(void);
  1425. void setup_logging(char *pname,BOOL interactive);
  1426. void reopen_logs(void);
  1427. void force_check_log_size(void);
  1428. char *tmpdir(void);
  1429. BOOL is_a_socket(int fd);
  1430. BOOL next_token(char **ptr,char *buff,char *sep);
  1431. char **toktocliplist(int *ctok, char *sep);
  1432. void *MemMove(void *dest,void *src,int size);
  1433. void array_promote(char *array,int elsize,int element);
  1434. void set_socket_options(int fd, char *options);
  1435. void close_sockets(void );
  1436. BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups);
  1437. char *StrCpy(char *dest,char *src);
  1438. char *StrnCpy(char *dest,char *src,int n);
  1439. void putip(void *dest,void *src);
  1440. int name_mangle( char *In, char *Out, char name_type );
  1441. BOOL file_exist(char *fname,struct stat *sbuf);
  1442. time_t file_modtime(char *fname);
  1443. BOOL directory_exist(char *dname,struct stat *st);
  1444. uint32 file_size(char *file_name);
  1445. char *attrib_string(int mode);
  1446. int StrCaseCmp(char *s, char *t);
  1447. int StrnCaseCmp(char *s, char *t, int n);
  1448. BOOL strequal(char *s1, char *s2);
  1449. BOOL strnequal(char *s1,char *s2,int n);
  1450. BOOL strcsequal(char *s1,char *s2);
  1451. void strlower(char *s);
  1452. void strupper(char *s);
  1453. void strnorm(char *s);
  1454. BOOL strisnormal(char *s);
  1455. void string_replace(char *s,char oldc,char newc);
  1456. void unix_format(char *fname);
  1457. void dos_format(char *fname);
  1458. void show_msg(char *buf);
  1459. int smb_len(char *buf);
  1460. void _smb_setlen(char *buf,int len);
  1461. void smb_setlen(char *buf,int len);
  1462. int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
  1463. int smb_numwords(char *buf);
  1464. int smb_buflen(char *buf);
  1465. int smb_buf_ofs(char *buf);
  1466. char *smb_buf(char *buf);
  1467. int smb_offset(char *p,char *buf);
  1468. char *skip_string(char *buf,int n);
  1469. BOOL trim_string(char *s,char *front,char *back);
  1470. void dos_clean_name(char *s);
  1471. void unix_clean_name(char *s);
  1472. int ChDir(char *path);
  1473. char *GetWd(char *str);
  1474. BOOL reduce_name(char *s,char *dir,BOOL widelinks);
  1475. void expand_mask(char *Mask,BOOL doext);
  1476. BOOL strhasupper(char *s);
  1477. BOOL strhaslower(char *s);
  1478. int count_chars(char *s,char c);
  1479. void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date);
  1480. void close_low_fds(void);
  1481. int set_blocking(int fd, BOOL set);
  1482. int write_socket(int fd,char *buf,int len);
  1483. int read_udp_socket(int fd,char *buf,int len);
  1484. int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out);
  1485. int read_max_udp(int fd,char *buffer,int bufsize,int maxtime);
  1486. int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew);
  1487. BOOL send_keepalive(int client);
  1488. int read_data(int fd,char *buffer,int N);
  1489. int write_data(int fd,char *buffer,int N);
  1490. int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align);
  1491. int read_smb_length(int fd,char *inbuf,int timeout);
  1492. BOOL receive_smb(int fd,char *buffer, int timeout);
  1493. BOOL client_receive_smb(int fd,char *buffer, int timeout);
  1494. BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout);
  1495. BOOL push_smb_message(char *buf, int msg_len);
  1496. BOOL receive_message_or_smb(int smbfd, int oplock_fd, 
  1497.                            char *buffer, int buffer_len, 
  1498.                            int timeout, BOOL *got_smb);
  1499. BOOL send_smb(int fd,char *buffer);
  1500. char *name_ptr(char *buf,int ofs);
  1501. int name_extract(char *buf,int ofs,char *name);
  1502. int name_len( char *s );
  1503. BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
  1504. void msleep(int t);
  1505. BOOL in_list(char *s,char *list,BOOL casesensitive);
  1506. BOOL string_init(char **dest,char *src);
  1507. void string_free(char **s);
  1508. BOOL string_set(char **dest,char *src);
  1509. BOOL string_sub(char *s,char *pattern,char *insert);
  1510. BOOL do_match(char *str, char *regexp, int case_sig);
  1511. BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2);
  1512. void become_daemon(void);
  1513. BOOL yesno(char *p);
  1514. char *fgets_slash(char *s2,int maxlen,FILE *f);
  1515. int set_filelen(int fd, long len);
  1516. int byte_checksum(char *buf,int len);
  1517. char *dirname_dos(char *path,char *buf);
  1518. void *Realloc(void *p,int size);
  1519. void Abort(void );
  1520. BOOL get_myname(char *my_name,struct in_addr *ip);
  1521. BOOL ip_equal(struct in_addr ip1,struct in_addr ip2);
  1522. int open_socket_in(int type, int port, int dlevel,uint32 socket_addr);
  1523. int open_socket_out(int type, struct in_addr *addr, int port ,int timeout);
  1524. int interpret_protocol(char *str,int def);
  1525. int interpret_security(char *str,int def);
  1526. uint32 interpret_addr(char *str);
  1527. struct in_addr *interpret_addr2(char *str);
  1528. BOOL zero_ip(struct in_addr ip);
  1529. void reset_globals_after_fork(void);
  1530. char *client_name(void);
  1531. char *client_addr(void);
  1532. char *automount_server(char *user_name);
  1533. char *automount_path(char *user_name);
  1534. void standard_sub_basic(char *str);
  1535. BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
  1536. int PutUniCode(char *dst,char *src);
  1537. struct hostent *Get_Hostbyname(char *name);
  1538. BOOL process_exists(int pid);
  1539. char *uidtoname(int uid);
  1540. char *gidtoname(int gid);
  1541. void BlockSignals(BOOL block,int signum);
  1542. void ajt_panic(void);
  1543. char *readdirname(void *p);
  1544. BOOL is_in_path(char *name, name_compare_entry *namelist);
  1545. void set_namearray(name_compare_entry **ppname_array, char *namelist);
  1546. void free_namearray(name_compare_entry *name_array);
  1547. BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
  1548. int file_lock(char *name,int timeout);
  1549. void file_unlock(int fd);
  1550. BOOL is_myname(char *s);
  1551. void set_remote_arch(enum remote_arch_types type);
  1552. enum remote_arch_types get_remote_arch(void);
  1553. char *skip_unicode_string(char *buf,int n);
  1554. char *unistrn2(uint16 *buf, int len);
  1555. char *unistr2(uint16 *buf);
  1556. int struni2(uint16 *p, char *buf);
  1557. char *unistr(char *buf);
  1558. int unistrncpy(char *dst, char *src, int len);
  1559. int unistrcpy(char *dst, char *src);
  1560. char *safe_strcpy(char *dest, char *src, int maxlength);
  1561. char *safe_strcat(char *dest, char *src, int maxlength);
  1562. char *align4(char *q, char *base);
  1563. char *align2(char *q, char *base);
  1564. char *align_offset(char *q, char *base, int align_offset_len);
  1565. void print_asc(int level, unsigned char *buf,int len);
  1566. void dump_data(int level,char *buf1,int len);
  1567. char *tab_depth(int depth);
  1568.